#!/usr/bin/python3
# @Time    : 2018/6/2 下午 17:00:23  
# @Author  : LaoJI
from app.models.base import Base
from sqlalchemy import Column, ForeignKey
from sqlalchemy import SmallInteger, Integer, TIMESTAMP, LargeBinary
from sqlalchemy import String
from sqlalchemy.orm import relationship


class ImageFile(Base):
    __tablename__ = 'ImageFile'
    id = Column(Integer, primary_key=True)
    image_name = Column(String(30), index=True)
    image = Column(LargeBinary(length=2048))

    uid = Column(Integer, ForeignKey('students.student_id'), nullable=False)

    def __init__(self, image_name, image, uid):
        self.image_name = image_name
        self.image = image
        self.uid = uid
